/**
 * px和vw相互转换
 * @param px 像素值
 */
// 默认参数
let defaultsProp = {
  unitToConvert: "px",
  viewportWidth: 1240,
  unitPrecision: 5,
  viewportUnit: "vw",
  fontViewportUnit: "vw",
  minPixelValue: 1
};
export let pxToVw = function(px) {
  if (typeof px === "number") {
    let tate = defaultsProp.viewportWidth / 100; // 比率 12.4
    let num = px / tate;
    return (
      Math.round(num * Math.pow(10, defaultsProp.unitPrecision)) /
        Math.pow(10, defaultsProp.unitPrecision) +
      "vw"
    );
  }
};

/*export function vwToPx(vw) {
  if (typeof vw === "number") {}
}*/

export let rest = function(...items) {
  items.forEach(function(item) {
    let res = item();
    if (!res) {
      alert("出错了");
    }
    console.log(res);
  });
};
